-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(helm): add snapshot functionality with automatic cleanup #5892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add snapshot configuration section to values.yaml with: - Enable/disable toggle - Cron schedule configuration - Format selection (dragonfly/rdb) - Cleaner settings (image, interval, max count, resources) - Add snapshot-cleaner sidecar container to pod template: - Automatically removes old snapshots based on max_count - Supports both dragonfly (.dfs) and rdb formats - Configurable cleanup interval and resource limits - Add snapshot cron arguments to main dragonfly container - Maintains backward compatibility with existing configurations
55c2fe3 to
493d357
Compare
| - -c | ||
| - | | ||
| while true; do | ||
| {{- if eq .Values.snapshot.format "dragonfly" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be "df" instead of "dragonfly" as you are keeping only two formats "df" and "rdb" from the comment below.
| while true; do | ||
| {{- if eq .Values.snapshot.format "dragonfly" }} | ||
| # Keep only the last {{ .Values.snapshot.cleaner.max_count }} snapshots (composed of two files each) | ||
| ls -1t /data/dump-*.dfs | tail -n +{{ add 1 (mul .Values.snapshot.cleaner.max_count 2) }} | xargs rm -f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tested provisioning this container locally? Just want to be sure this script works.
| - "--snapshot_cron" | ||
| - "{{ .Values.snapshot.schedule }}" | ||
| {{- if eq .Values.snapshot.format "rdb" }} | ||
| - "--nodf_snapshot_format" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romange do we have this flag? I think --df_snapshot_format=false is the correct flag to have rdb format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's equivalent, though I am surprised that people know this notion as it is a special format for boolean flags in google flags library :) @renan how did you know? :)
Add snapshot configuration section to values.yaml with:
Add snapshot-cleaner sidecar container to pod template:
Add snapshot cron arguments to main dragonfly container
Maintains backward compatibility with existing configurations
Fixes #2824